<template>
  <el-dialog
    :title="chartData.legend"
    :visible="visible"
    :width="device === 'mobile' ? '400px' : '1200px'"
    :before-close="
      () => {
        $emit('cancel');
      }
    "
  >
    <base-chart
      v-if="visible"
      :chart-data="chartData"
      type="bar"
      :height="device === 'mobile' ? '240px' : '600px'"
    />
    <div slot="footer" class="dialog-footer">
      <el-button
        @click="
          () => {
            $emit('cancel');
          }
        "
      >取 消</el-button>
      <el-button
        type="primary"
        @click="
          () => {
            $emit('cancel');
          }
        "
      >确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
// import { getContractInfo } from '@/api/buildManage'
import { mapState } from 'vuex'
export default {
  components: {
    BaseChart: () => import('./proFundScheduleBaseChart')
  },
  props: {
    visible: {
      type: Boolean,
      required: true
    },
    chartData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {}
  },
  computed: {
    ...mapState({
      device: (state) => state.app.device
    })
  },
  created() {},
  methods: {}
}
</script>
